<template>
  <div class="demo-input-suffix">
    <!-- 选择隧道:
    <el-select v-model="tId" placeholder="请选择">
      <el-option command="e" v-for="v in tunnelList" :label="v.proName" :key="v.id" :value="v.id"></el-option>
    </el-select>
    <el-button class="select" @click="findByTid" type="primary">查询</el-button> -->
    <el-button icon="el-icon-plus"  class="save" @click="addProductHandle" type="info">添加</el-button>
  </div>
</template>

<script>
import api from '../../../api'
export default {
  data() {
    return {
      tunnelList: [],
      tId: ''
    }
  },
  mounted() {
    // 查询隧道
    api
      .tunnelInfoFindByAll()
      .then((res) => {
        if (res.data.code == 2001) {
          this.tunnelList = res.data.data
        }
      })
      .catch((err) => {
        console.log(err)
      })
  },
  methods: {
    addProductHandle() {
      this.$bus.$emit('onAddSection', true)
    },
    findByTid() {
      this.setTunName(this.tId)
    }
  }
}
</script>

<style scoped>
.demo-input-suffix {
  margin-top: 20px;
  text-align: left;
}
.select{
  margin-left: 10px;
}

.save{
   margin-left: 10px;
   border: none;
   border: 2px solid #409EFF;
   background-color: white;
   color: #409EFF;

}
</style>